﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using RMS.Models;

namespace RMS.Views
{
    public class ViewHelper
    {
        RMSDataClassesDataContext db = new RMSDataClassesDataContext();
       /* public string CompanyRiskMatrix(int companyId)
        {
            List<ProblemScore> scores = db.ProblemScores.Where(x => x.CompanyId.HasValue).Where(x => x.CompanyId == companyId).ToList();
            string result = "";
            result += "<table>";
            for (int i = 1; i <= 5; i++)
            {
                result+="<tr>";
                for (int j = 1; j <= 5; j++)
                {
                    result+="<td>";
                    foreach(var item in scores.Where(x=>
                        (x.ImpactScore == (decimal)i)&&(x.ProbabilityScore==(decimal)j)))
                        {
                        result += "<a href=\"/Problem/Details/";
                        result += item.Id.ToString();
                        result += "\">";
                        result += item.Problem.Name;
                        result += "</a> ";
                    }
                    result += "</td>";
                }
                result += "</tr>";
            }
            return result;
        }*/
    }
}